package com.itheima.d8_thread_pool.ZengTest;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @ClassName ZengThreadPoolTest1
 * @Author 16799
 * @Date 2025/9/23 18:42
 * @Version 1.0
 * @Description TODO
 **/
public class ZengThreadPoolTest1 {
    public static void main(String[] args) {
        ThreadPoolExecutor zpool = new ThreadPoolExecutor(3,5,10, TimeUnit.SECONDS,
                new LinkedBlockingDeque<>(2),
                Executors.defaultThreadFactory(),new ThreadPoolExecutor.CallerRunsPolicy());

        zpool.execute(new ZengMyRunnable());
        zpool.execute(new ZengMyRunnable());
        zpool.execute(new ZengMyRunnable());
    }
}
